package com.kifas.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "tb_pengiriman")
public class PengirimanEntity implements Serializable {

	private static final long serialVersionUID = 5854901987438581852L;

	@Id
	@GeneratedValue
	@Column(name = "id_pengiriman")
	private Long idPengiriman;

	@Column(name = "no_pengiriman")
	private String noPengiriman;

	@Column(name = "id_penjualan")
	private Long idPenjualan;

	@Column(name = "id_jenis_ekspedisi")
	private String idJenisEkspedisi;

	@Column(name = "tanggal_do")
	@Temporal(TemporalType.TIMESTAMP)
	private Date tanggalDo;

	@Column(name = "tanggal_kirim")
	@Temporal(TemporalType.TIMESTAMP)
	private Date tanggalKirim;

	@Column(name = "tanggal_terima")
	@Temporal(TemporalType.TIMESTAMP)
	private Date tanggalTerima;
	
	@Column(name = "nomor_surat_jalan")
	private String noSuratJalan;

	private String keterangan;

	@Column(name = "no_kendaraan")
	private String noKendaraan;

	@OneToMany(mappedBy = "pengiriman", targetEntity = PengirimanDetailEntity.class, fetch = FetchType.LAZY)
	private Set<PengirimanDetailEntity> pengirimanDetails;

//	@ManyToOne
//	@JoinColumn(name = "id_master_gudang", nullable = false)
//	private GudangEntity gudang;
	@Column(name= "created_by")
	private String createdBy;
	
	@Column(name= "created_date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createdDate;

	public PengirimanEntity() {
	}

	public PengirimanEntity(Long idPengiriman, String noPengiriman,
			Long idPenjualan, String idJenisEkspedisi, Date tanggalDo,
			Date tanggalKirim, Date tanggalTerima, String noSuratJalan, String keterangan,
			String noKendaraan, Set<PengirimanDetailEntity> pengirimanDetails,
			String createdBy, Date createdDate) {
		this.idPengiriman = idPengiriman;
		this.noPengiriman = noPengiriman;
		this.idJenisEkspedisi = idJenisEkspedisi;
		this.tanggalDo = tanggalDo;
		this.tanggalKirim = tanggalKirim;
		this.tanggalTerima = tanggalTerima;
		this.keterangan = keterangan;
		this.noSuratJalan = noSuratJalan;
		this.noKendaraan = noKendaraan;
		this.idPenjualan = idPenjualan;
		this.pengirimanDetails = pengirimanDetails;
		this.createdBy = createdBy;
		this.createdDate = createdDate;
//		this.gudang = gudang;
	}

	public Long getIdPengiriman() {
		return idPengiriman;
	}

	public void setIdPengiriman(Long idPengiriman) {
		this.idPengiriman = idPengiriman;
	}

	public String getNoPengiriman() {
		return noPengiriman;
	}

	public void setNoPengiriman(String noPengiriman) {
		this.noPengiriman = noPengiriman;
	}

	public String getIdJenisEkspedisi() {
		return idJenisEkspedisi;
	}

	public void setIdJenisEkspedisi(String idJenisEkspedisi) {
		this.idJenisEkspedisi = idJenisEkspedisi;
	}

	public Date getTanggalDo() {
		return tanggalDo;
	}

	public void setTanggalDo(Date tanggalDo) {
		this.tanggalDo = tanggalDo;
	}

	public Date getTanggalKirim() {
		return tanggalKirim;
	}

	public void setTanggalKirim(Date tanggalKirim) {
		this.tanggalKirim = tanggalKirim;
	}

	public Date getTanggalTerima() {
		return tanggalTerima;
	}

	public void setTanggalTerima(Date tanggalTerima) {
		this.tanggalTerima = tanggalTerima;
	}

	public String getKeterangan() {
		return keterangan;
	}

	public void setKeterangan(String keterangan) {
		this.keterangan = keterangan;
	}

	public String getNoKendaraan() {
		return noKendaraan;
	}

	public void setNoKendaraan(String noKendaraan) {
		this.noKendaraan = noKendaraan;
	}

	public Set<PengirimanDetailEntity> getPengirimanDetails() {
		return pengirimanDetails;
	}

	public void setPengirimanDetails(Set<PengirimanDetailEntity> pengirimanDetails) {
		this.pengirimanDetails = pengirimanDetails;
	}

	public Long getIdPenjualan() {
		return idPenjualan;
	}

	public void setIdPenjualan(Long idPenjualan) {
		this.idPenjualan = idPenjualan;
	}

	public void setNoSuratJalan(String noSuratJalan) {
		this.noSuratJalan = noSuratJalan;
	}

	public String getNoSuratJalan() {
		return noSuratJalan;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

//	public GudangEntity getGudang() {
//		return gudang;
//	}
//
//	public void setGudang(GudangEntity gudang) {
//		this.gudang = gudang;
//	}

}
